﻿using Microsoft.EntityFrameworkCore;
using MyTask.Domain.Models;
using System;
using System.Collections.Generic;
using System.Text;

namespace MyTask.Infrastructure.Context
{
   public class MyTaskContext:DbContext
    {
        public DbSet<Post> Posts { get; set; }
        public DbSet<UserInfo> UserInfos { get; set; }

        public DbSet<TaskInfo> TaskInfos { get; set; }

        public DbSet<ShareTask> ShareTasks { get; set; }

        public MyTaskContext(DbContextOptions options) : base(options)
        {
        }


        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<Post>().HasData(new Post() { Id = 1, Title = "O bella ciao", Body = "La casa de papel" });
        }
    }
}
